<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:r="http://richfaces.org/rich"
	>

		<a4j:outputPanel id="editStock">
		<!--  first row basics   -->
		<p><b>Basisdaten</b></p>
		<p class="edit60px">
			<a target="blank" href="http://www.onvista.de/aktien/snapshot.html?ID_OSI=#{stockController.stock.onVistaId}" > 
				<h:outputLabel for="wkn" value="wkn:" />
			</a>
			<h:inputText id="wkn" value="#{stockController.stock.wkn}" >
				<a4j:ajax event="blur" listener="#{stockController.setStockIfPresent}" render="editStock,stockResult,stocksTable"/>
			</h:inputText>
			<h:message for="wkn" errorClass="invalid" />
			<h:outputLabel for="name" value="name:" />
			<h:inputText id="name" value="#{stockController.stock.name}" />
			<h:message for="name" errorClass="invalid" />

			<h:outputLabel for="captype" value="captype:" />
			<h:selectOneMenu id="captype"
				value="#{stockController.stock.capType}">
				<f:selectItems value="#{helperController.capTypes}" var="item"
					itemLabel="#{item}" itemValue="#{item}" />
			</h:selectOneMenu>
			<h:message for="nacaptypeme" errorClass="invalid" />

			<h:outputLabel for="dividende" value="dividende" />
			<h:inputText id="dividende"
				value="#{stockController.stock.dividende}" />
			<h:message for="dividende" errorClass="invalid" />
		</p>

		<!-- sedond row -->
		<p><b>Kennzahlen</b></p>
		<p>
			<h:outputLabel for="roeLj" value="roeLj:" />
			<h:inputText id="roeLj" value="#{stockController.stock.roeLj}" />
			<h:message for="roeLj" errorClass="invalid" />

			<h:outputLabel for="ebitLj" value="ebitLj:" />
			<h:inputText id="ebitLj" value="#{stockController.stock.ebitLj}" />
			<h:message for="ebitLj" errorClass="invalid" />

			<h:outputLabel for="eigKapQuLj" value="eigKapQuLj" />
			<h:inputText id="eigKapQuLj"
				value="#{stockController.stock.eigKapQuLj}" />
			<h:message for="eigKapQuLj" errorClass="invalid" />

			<h:outputLabel for="reaktionQz" value="reaktionQz:" />
			<h:inputText id="reaktionQz"
				value="#{stockController.stock.reaktionQz}" />
			<h:message for="reaktionQz" errorClass="invalid" />

			<h:outputLabel for="gewinnRev" value="gewinnRev" />
			<h:inputText id="gewinnRev"
				value="#{stockController.stock.gewinnRev}" />
			<h:message for="gewinnRev" errorClass="invalid" />

			<h:outputLabel for="epsAj" value="epsAj" />
			<h:inputText id="epsAj" value="#{stockController.stock.epsAj}" />
			<h:message for="epsAj" errorClass="invalid" />

			<h:outputLabel for="epsNj" value="epsNj" />
			<h:inputText id="epsNj" value="#{stockController.stock.epsNj}" />
			<h:message for="epsNj" errorClass="invalid" />

		</p>



		<!-- third row  kgvs     -->
		<p><b>KGVS</b></p>
		<p>
			<h:outputLabel for="kgvAj" value="kgvAj:" />
			<h:inputText id="kgvAj" value="#{stockController.stock.kgvAj}" />
			<h:message for="kgvAj" errorClass="invalid" />

			<h:outputLabel for="kgv1j" value="kgv1j:" />
			<h:inputText id="kgv1j" value="#{stockController.stock.kgv1j}" />
			<h:message for="kgv1j" errorClass="invalid" />

			<h:outputLabel for="kgv2j" value="kgv2j:" />
			<h:inputText id="kgv2j" value="#{stockController.stock.kgv2j}" />
			<h:message for="kgv2j" errorClass="invalid" />

			<h:outputLabel for="kgv3j" value="kgv3j:" />
			<h:inputText id="kgv3j" value="#{stockController.stock.kgv3j}" />
			<h:message for="kgv3j" errorClass="invalid" />

			<h:outputLabel for="kgv4j" value="kgv4j:" />
			<h:inputText id="kgv4j" value="#{stockController.stock.kgv4j}" />
			<h:message for="kgv4j" errorClass="invalid" />
		</p>


		<!-- 4th row  kurse    -->
		<p><b>KURSE</b></p>
		<p>
			<label style="width: 10em;" for="kursNow"  >zzz</label>
			<h:inputText id="kursNow" value="#{stockController.stock.kursNow}" />
			<h:message for="kursNow" errorClass="invalid" />

			<h:outputLabel for="kurs6monate" value="kurs6monate" />
			<h:inputText id="kurs6monate"
				value="#{stockController.stock.kurs6monate}" />
			<h:message for="kurs6monate" errorClass="invalid" />

			<h:outputLabel for="kurs1jahr" value="kurs1jahr" />
			<h:inputText id="kurs1jahr"
				value="#{stockController.stock.kurs1jahr}" />
			<h:message for="kurs1jahr" errorClass="invalid" />

		</p>

		<!--		-->
		<p><b>Sonstiges</b></p>
		<p>
			<h:outputLabel for="dreimonatsReversal" value="dreimonatsReversal" />
			<h:selectOneMenu id="dreimonatsReversal"
				value="#{stockController.stock.dreimonatsReversal}">
				<f:selectItems value="#{helperController.dreiMonatsReversals}"
					var="item" itemLabel="#{item}" itemValue="#{item}" />
			</h:selectOneMenu>
			<h:message for="dreimonatsReversal" errorClass="invalid" />

			<h:outputLabel for="analystenMeinung" value="analystenMeinung" />
			<h:selectOneMenu id="analystenMeinung"
				value="#{stockController.stock.analystenMeinung}">
				<f:selectItems value="#{helperController.analystenMeinungen}"
					var="item" itemLabel="#{item}" itemValue="#{item}" />
			</h:selectOneMenu>
			<h:message for="analystenMeinung" errorClass="invalid" />

		</p>
		<!--   5th row Buttons                -->
		<p class="edit100px">
			<h:commandButton id="saveStock" value="Save stock"
				action="#{stockController.saveStock}" />
			<h:outputText value=" All clear!"
				rendered="#{facesContext.postback and empty facesContext.messageList}"
				style="color: green;" />
			<h:messages showDetail="true" />
			<h:commandButton id="openStock"
				readonly="#{empty facesContext.messageList and facesContext.messageList[0].summary == 'wkn allready used'}"
				value="Open this stock" action="#{stockController.openStock}" />
		</p>
		</a4j:outputPanel>
</ui:composition>
